
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html"%>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic"%>
<%@ taglib uri="http://displaytag.sf.net/el" prefix="display"%>
<%@ taglib uri="/WEB-INF/config/tld/fmt.tld" prefix="fmt" %>
<%@ taglib uri="http://ssh.org/selects" prefix="ssh"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path;
String applicationPath = basePath + "/" + "application";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<link href="<%=path%>/css/jinmu_style.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="<%=path%>/js/util.js"></script>
		<script type='text/javascript' src='<%=path%>/frame/orgSelect/js/ajaxInitSelect.js'></script>
<script language="javascript" src="<%=path%>/js/SyncCommon.js"></script>
</head>
<body>
<html:form styleId="yfFeeReimburForm" action="updateYfFeeReimbur.do?method=updateYfFeeReimbur" onsubmit="return save();">
<html:hidden property="id" value="${yfFeeReimbur.id}"/>
<html:hidden property="processId" value="${yfFeeReimbur.processId}"/>
<html:hidden property="auditStatus" value="${yfFeeReimbur.auditStatus}"/>
<input type ="hidden" name="projectid" id="projectid" value="${yfFeeReimbur.projectNo}"/>
<table cellspacing="0" cellpadding="0" width="98%" align="center"  border="0" class="margtb5">
		    <tr>
		      <td align="left" class="padl5 lan12"><img src="<%=path%>/images/img-11.gif" width="12" height="12"> 研发辅助 &gt; 项目费用 &gt; 费用报销 &gt; 编辑</td>
		    </tr>
       </table>
	
	   
	    <table cellspacing="1" cellpadding="0" width="98%" align="center"  border="0" class="bgcolor2 margb5">
	          <tr>
		       <td colspan="4" align="left" class="bkuang zi13b bgcolor2 padl5">费用报销信息</td>
		    </tr>
        <tr class="bgcolor">
	   <td width="18%" align="right" class="zi13"><bean:message key="com.application.yffeereimbur.entity.yffeereimbur.createpage.applyNo" bundle="yffeereimbur"/>：<font color="red">*&nbsp;</font></td>
	   <td width="32%"  align="left" class="pad2 zi13">
	        <input type="text" id="applyNo" name="applyNo"  flag="true"  maxlength="60"  valid="required" errMsg="请输入费用申请单号！" readonly="true" value="${yfFeeReimbur.applyNo}" /> <input type="button" onclick="chooseProject();" name="choose" value="选择" class="buttonbg" style="cursor:hand">
		         		                       		  
	  </td>

 
	 <td width="18%" align="right" class="zi13"><bean:message key="com.application.yffeereimbur.entity.yffeereimbur.createpage.applyDate" bundle="yffeereimbur"/>：<font color="red">*&nbsp;</font></td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				  <input type="text"  flag="true"  maxlength="60"  valid="required" errMsg="请输入报销时间！" readonly="true"  value="<bean:write name="yfFeeReimbur" property="applyDate" format="yyyy-MM-dd"/>"  name="applyDateStr" id="applyDateStr" readonly="true"  onclick="popUpCalendarDlg(this)" />
		         		                       		  
	  </td>
		         		                       		  
	  </td>

        </tr>
  <tr class="bgcolor">
	   <td width="18%" align="right" class="zi13">报销人：</td>
	   <td width="32%"  align="left" class="pad2 zi13"  >
	                               				 <input type="text" readonly="true"  readonly="true" id="rname" name="rname" value="${yfFeeReimbur.rname}"/>
	                               				  <input type="hidden" readonly="true"  readonly="true" id="operateid" name="operateid" value="${yfFeeReimbur.operateid}"/>
	                               				 
		         		                       		  
	  </td>

 	   <td width="18%" align="right" class="zi13">所属机构：</td>
	   <td width="32%"  align="left" class="pad2 zi13"  >
	                               				 <input type="text" readonly="true" readonly="true" id="org" name="org" value="${yfFeeReimbur.org}"/>
		         		                       		  
	  </td>
 

        </tr>
        <tr class="bgcolor">
	   <td width="18%" align="right" class="zi13"><bean:message key="com.application.yffeereimbur.entity.yffeereimbur.createpage.applyMoney" bundle="yffeereimbur"/>：<font color="red">*&nbsp;</font></td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" flag="true"  maxlength="13" valid="required|isWanYuan" errMsg="请输入金额！|请输入正确的金额！" id="applyMoney" name="applyMoney" value="${yfFeeReimbur.applyMoney}"/>
		         		                       		  
	  </td>

 	   <td width="18%" align="right" class="zi13"><bean:message key="com.application.yffeereimbur.entity.yffeereimbur.createpage.billsNum" bundle="yffeereimbur"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" flag="true"  maxlength="13" valid="isInt" errMsg="请输入正确的单据张数！" id="billsNum" name="billsNum" value="${yfFeeReimbur.billsNum}"/>
		         		                       		  
	  </td>


        </tr>
 
        <tr class="bgcolor">
	   

 
	 <td width="18%" align="right" class="zi13"><bean:message key="com.application.yffeereimbur.entity.yffeereimbur.createpage.feeType" bundle="yffeereimbur"/>：<font color="red">*&nbsp;</font></td>
	   <td width="32%"  align="left" class="pad2 zi13" colspan="3">
	         		  		  <ssh:select propertyName="feeType" pid="FEE_TYPE" type="1" defaultName="${yfFeeReimbur.feeType}" onChangeValue="showXM();"/>
		  
	  </td>
		         		                       		  
	  </td>

        </tr>
   <tr class="bgcolor" id="xmtr" style="display:none;">
	   <td width="18%" align="right" class="zi13">项目名称：<font color="red">*&nbsp;</font></td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" id="projectName" name="projectName" readonly="true" value="${yfFeeReimbur.projectName}"/>
	                               			<!-- 	 <input type="button" onclick="chooseProject();" name="choose" value="选择" class="buttonbg" style="cursor:hand"> -->
		         		                       		  
	  </td>

 
	   <td width="18%" align="right" class="zi13">项目编号：</td>
	   <td width="32%"  align="left" class="pad2 zi13">
	                               				 <input type="text" readonly="true" id="projectNo" name="projectNo" value="${yfFeeReimbur.projectNo}"/>
		         		                       		  
	  </td>

        </tr> 
        <tr class="bgcolor">
	     <td width="18%" align="right" class="zi13"><bean:message key="com.application.yffeereimbur.entity.yffeereimbur.createpage.summary" bundle="yffeereimbur"/>：</td>
	   <td width="32%"  align="left" class="pad2 zi13" colspan="3">
	                               			<textarea rows="6"  flag="true"  valid="limitLength" max="500" errMsg="摘要输入长度不能超过500个汉字" cols="60" id="summary" name="summary">${yfFeeReimbur.summary}</textarea>长度不超过500个字	
		         		                       		  
	  </td>

        </tr>
  <tr>
					    <td colspan="4">
		                    <iframe width="100%" height="150px" onload="this.height=show_attachment.document.body.scrollHeight"
							src="<%=path%>/queryAttachment.do?method=queryAttachment&fid=${yfFeeReimbur.id}&type=10012"
											; scrolling="no" frameborder="0" name="show_attachment"
											id="show_attachment"></iframe>       
					    </td>
					  </tr>		
 

    </table> 

		<p><p><p>
	
  <table width="98%" align="center" border="0" cellspacing="0" cellpadding="0">
  <tr>
        <td align="center">
		<input class="buttonbg" id="but_save"  style="cursor:hand"  type="submit" value="<bean:message key='com.manager.common.yffeereimbur.save' bundle="yffeereimbur"/>" name="but_save" />
		  &nbsp;&nbsp;&nbsp;
	     <input class="buttonbg" id="but_return"  style="cursor:hand"  type="button" value="<bean:message key='com.manager.common.yffeereimbur.return' bundle="yffeereimbur"/>" name="but_return" onClick="javascript:history.go(-1);"/>
		 </td>
  </tr>
</table>

</html:form>
</body>
</html>


<script>
<c:if test="${yfFeeReimbur.feeType==1 || yfFeeReimbur.feeType==2 || yfFeeReimbur.feeType==3}">
   ${"xmtr"}.style.display = "block";
</c:if>
function save(){
   if(validateForm(document.forms[0],'Y'))
   {
    var syncHelper = new SyncHelper();
       var feeType = syncHelper.selectedValue("feeType");
       if(feeType==null || feeType==""){
          alert("请选择费用类型！");
          return false;
       }
       if(feeType=="1" || feeType=="2" || feeType=="3"){
           var projectName = $("projectName").value;
           if(projectName==null || projectName==""){
               alert("请选择项目！");
               return false;
           }
       }
	return true;
    }else{
	return false;
    }
}
function showXM(){
	var syncHelper = new SyncHelper();
	var sevaule = syncHelper.selectedValue("feeType");
	var trb = ${"xmtr"}.style.display;
	if(sevaule=="1" || sevaule=="2" || sevaule=="3"){
	    ${"xmtr"}.style.display = "block";
	}else{
	     ${"xmtr"}.style.display  = "none";
	}
	 
}
function chooseProject(){   
    var syncHelper = new SyncHelper();
	var url = "popuSelectProjectList.do?method=popuSelectProjectList&random=" + new Date();
	var searchWin = window.showModalDialog(url,window,"help:no;scroll:yes;resizable:no;status:0;dialogWidth:1000px;dialogHeight:600px;center:yes" ); 	
    if(searchWin){
         $("projectName").value = searchWin["projectName"]==undefined?"":searchWin["projectName"];
		 $("projectNo").value = searchWin["projectNo"]==undefined?"":searchWin["projectNo"];
		 $("projectid").value = searchWin["projectNo"]==undefined?"":searchWin["projectNo"];
		 //$jq("#projectOrg option").not(":selected").attr("disabled", "disabled");

		 
    }
}


//提交审核
function returnSubmits(){
    if(validateForm(document.forms[0],'Y'))
	{
	   var syncHelper = new SyncHelper();
       var feeType = syncHelper.selectedValue("feeType");
       if(feeType==null || feeType==""){
          alert("请选择费用类型！");
          return false;
       }
       if(feeType=="1" || feeType=="2" || feeType=="3"){
           var projectName = $("projectName").value;
           if(projectName==null || projectName==""){
               alert("请选择项目！");
               return false;
           }
       }
	    
	    if(confirm("是否提交审核？") ){
	    	document.forms[0].action="submitWorkFlowYfFeeReimbur.do?method=submitWorkFlowYfFeeReimbur&submitType=update";
	        document.forms[0].submit();
		    return true;
	    }
	    return false;
	   
		
	}else{
	    return false;
	}
	
}


</script>





